
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<div>

    <p align="right"><a href="sale.do?action=listFillter" >Package Duration</a>||
        <a href="sale.do?action=listFillterT" >Package Type</a>||
        <a href="sale.do?action=listFillterP" >Package Cost</a>||
        <a href="#" >Income range of customers</a>||
        <a href="sale.do?action=listFillterJ" >Group type of customers</a> ||
        <a href="sale.do?action=listFillterS" >Season</a> &emsp;&emsp;&emsp;

    </p>

    <table width="100%" border="0">

        <tr bgcolor="#F0F0F0">

            <td><font size="1">TourName</font></td>
            <td><font size="1">Departure</font></td>
            <td><font size="1">Destination</font></td>
            <td><font size="1">TypeName</font></td>

            <td><font size="1">Name Customer</font></td>
            <td><font size="1">Email</font></td>
            <td><font size="1">JobName</font></td>
            <td><font size="1">Duration</font></td>
            <td><font size="1">Day</font></td>
            <td><font size="1">Month</font></td>

            <td><font size="1">Year</font></td>
            <td><font size="1">Total</font></td>



        </tr>
        <logic:present name="listFill">
            <logic:iterate id="list" name="listFill">
                <tr bgcolor="#F0F0F0">

                    <td><font size="1"><bean:write name="list" property="tourName"/></font></td>
                    <td><font size="1"><bean:write name="list" property="departure"/></font></td>
                    <td><font size="1"><bean:write name="list" property="destination"/></font></td>
                    <td><font size="1"><bean:write name="list" property="typeName"/></font></td>
                    <td><font size="1"><bean:write name="list" property="fullName"/></font></td>
                    <td><font size="1"><bean:write name="list" property="email"/></font></td>
                    <td><font size="1"><bean:write name="list" property="jobName"/></font></td>
                    <td><font size="1"><bean:write name="list" property="duration"/></font></td>
                    <td><font size="1"><bean:write name="list" property="day"/></font></td>
                    <td><font size="1"><bean:write name="list" property="month"/></font></td>
                    <td><font size="1"><bean:write name="list" property="year"/></font></td>
                    <td><font size="1"><bean:write name="list" property="total"/></font></td>



                </tr>
            </logic:iterate>
        </logic:present>
    </table>
    <form action="sale.do?action=TotalD" method="post">
       
            <table>
                <tr bgcolor="#F0F0F0" >
                    <td><b><font size="4" color="blue"> Package Tour Duration </font></b></td>
                    <td><input type="text" name="duration" id="duration" value="${duration}"/></td>
                    <td><input type="submit" name="action" value="Total" onclick="return formValidator()"/></td>

                    <td></td>
                    <td></td>
                    <td></td>
                    <td> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;<font size="4" color="blue"><b>${sum} USD</b></font>${err}</td>

                </tr>
            </table>
    
    </form>

</div>
<script language="JavaScript">
    function notEmpty(elem, helperMsg){
        if(elem.value.length == 0){
            alert(helperMsg);
            elem.focus(); // set the focus to this input
            return false;
        }
        return true;
    }
    function isNumeric(elem, helperMsg){
        var numericExpression = /^[0-9]+$/;
        if(elem.value.match(numericExpression)){
            return true;
        }else{
            alert(helperMsg);
            elem.focus();
            return false;
        }
    }
    function formValidator(){
        // Make quick references to our fields
        var duration = document.getElementById('duration');

        // Check each input in the order that it appears in the form!
        if(notEmpty(duration, "Please enter your duration")){
            if(isNumeric(duration, "Please enter your number")){

                return true;
            }
        }
        return false;
    }




</script>
